package edu.yzu.testspringboot002.common.constant;

import cn.hutool.core.util.RandomUtil;

public class RedisUserKeyConstants {

    public static String getUserInfoKey(String username) {
        return String.format("user:info:%s", username);
    }

    public static Long getTimeOut() {
        return RandomUtil.randomLong(600, 10000);
    }

    public static String getOpenIdKey(String openId) {
        return String.format("user:openid:%s", openId);
    }

    public static String getPhoneKey(String phone) {
        return String.format("user:phone:%s", phone);
    }

    public static String getUserSignKey(String userName) {
        return "user:sign:" + userName;
    }

    public static Long getImTimeOut() {
        return RandomUtil.randomLong(1000, 6000) + 60 * 60 * 24 * 7;
    }


    public static String getUserImgUrlKey(String openId) {
        return "user:img:" + openId;
    }

    public static String getDoctorLockKey(Integer doctorId) {
        return "DOCTOR:" + doctorId;
    }

    public static final String LOCAL_COMPANY_REF = "COMPANY";

    public static String getLockLoginKey(String phone) {
        return "LOGIN:LOCK" + phone;
    }

    public static  String getUpdatePasswordKey(String phone) {
        return "UPDATE:PASSWORD:" + phone;
    }
}
